package com.leinao.constant;


/**
 * 常量表
 * @author  wangshoufa 
 * @date 2018年11月12日 上午11:07:29
 *
 */
public class Constant {
	
	
	/**
	 *接口访问成功code码
	 */
    public final static Integer SUCCESS_CODE = 200;
    /**
     * 异常信息统一头信息<br>
     * 非常遗憾的通知您,程序发生了异常
     */
    public static final String EXCEPTION_HEAD = "boom。炸了。";
    /**
     * 缓存键值
     */
//    public static final Map<Class<?>, String> cacheKeyMap = new HashMap<>();
    /**
     * 保存文件所在路径的key，eg.FILE_MD5:1243jkalsjflkwaejklgjawe
     */
    public static final String FILE_MD5_KEY = "FILE_MD5:";
    /**
     * 保存上传文件的状态
     */
    public static final String FILE_UPLOAD_STATUS = "FILE_UPLOAD_STATUS";

    /**
     *  七牛文件存储域名
     */
    public final static String QINIU_DOMAIN = "http://img.cnbita.com/";

    // 默认页数
    public final static Integer DEFAULT_PAGE_NUMBER = 1;
    // 默认每页显示条数
    public final static Integer DEFAULT_PAGE_SIZE = 10;

    /**
     * 用户session信息KEY
     */
    public final static String USER_SESSION_KEY = "userInfo";

    /**
     * 项目目录结构化
     */
    public final static String PROJECT_CODE_STRUCTURE = "/code";
    public final static String TASK_OUTPUTS_STRUCTURE = "/outputs";

    /**
     * git目录工程名
     */
    public final static String GIT_CODE_STRUCTURE = "code";

    // readme.md文件处理
    public final static String SMALL_README = "readme.md";
    public final static String BIG_README = "README.md";

    // 默认编码
    public final static String DEFAULT_CHARSET = "UTF-8";
    /**
     * 字符串"."常量定义
     */
    public final static String CUT_PERIOD = ".";
    /**
     * 字符串"."常量定义
     */
    public final static String CUT_SLASH = "/";
    /**
     * 方法名是否包含"login"字符串
     */
    public final static String METHOD_NAME_STARTSWITH_LOGIN = "login";

    /**
     * 用户Token
     */
    public final static String USER_TOKEN = "token";
    public final static String USER_BITA_TOKEN = "bitaToken";

    /**
     * 200  访问成功
     * 202  已经接受请求，但未处理完成
     * 500  服务器出错
     * 404  链接无效
     * 400  客户端请求的语法错误，服务器无法理解
     * 401  请求要求用户的身份认证
     * 409  服务器完成客户端的PUT请求是可能返回此代码，服务器处理请求时发生了冲突
     */
    public final static int RESPONSE_STATUS_SUCCESS = 200;
    public final static int RESPONSE_STATUS_ACCEPTED = 202;
    public final static int RESPONSE_STATUS_SERVER_ERROR = 500;
    public final static int RESPONSE_STATUS_INVALID_LINK = 404;
    public final static int RESPONSE_STATUS_BAD_REQUEST_ERROR = 400;
    public final static int RESPONSE_STATUS_UNAUTHORIZED_ERROR = 401;
    public final static int RESPONSE_STATUS_CONFLICT_ERROR = 409;

    // git 空文件夹处理
    public final static String HANDLE_GIT_EMPTY_DIR = ".gitkeep";

    public final static String USER_HOME_PREFIX = "/ghome/";

    public final static Integer DATASET_TYPE = 1;
    public final static Integer MODEL_TYPE = 2;

    // 项目文件最大限制200M
    public final static Long MAX_PROJECT_FILE_SIZE = 200 * 1024 * 1024L;
}

